#pragma once
#include "../../renderer/FrameBuffer.h"

namespace lazy {

    class GLFrameBuffer : public FrameBuffer {
    public:
        GLFrameBuffer(const FramebufferSpecification& spec);
        ~GLFrameBuffer() override;
        void Invalidate();
        void Bind() override;
        void Unbind() override;
        void Resize(uint32_t width, uint32_t height) override;
        int ReadPixel(uint32_t attachmentIndex, int x, int y) override;
        void ClearAttachment(uint32_t attachmentIndex, int value) override;
        uint32_t GetColorAttachmentBufferID(uint32_t index = 0) const override;
        const FramebufferSpecification &GetSpecification() const override;

    private:
        uint32_t m_BufferID = 0;
        FramebufferSpecification m_Specification;
        std::vector<FrameBufferTextureSpecification> m_ColorAttachmentSpecifications;
        FrameBufferTextureSpecification m_DepthAttachmentSpecification = FrameBufferTextureFormat::None;
        std::vector<uint32_t> m_ColorAttachments;
        uint32_t m_DepthAttachment = 0;
    };

} // lazy
